/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum OrdStatus implements org.f1x.api.message.types.ByteEnum {
	NEW((byte)'0'),
	PARTIALLY_FILLED((byte)'1'),
	FILLED((byte)'2'),
	DONE_FOR_DAY((byte)'3'),
	CANCELED((byte)'4'),
	REPLACED((byte)'5'),
	PENDING_CANCEL((byte)'6'),
	STOPPED((byte)'7'),
	REJECTED((byte)'8'),
	SUSPENDED((byte)'9'),
	PENDING_NEW((byte)'A'),
	CALCULATED((byte)'B'),
	EXPIRED((byte)'C'),
	ACCEPTED_FOR_BIDDING((byte)'D'),
	PENDING_REPLACE((byte)'E');

	private final byte code;

	OrdStatus (byte code) {
		this.code  = code;
	}

	public byte getCode() { return code; }

	public static OrdStatus parse(String s) {
		switch(s) {
			case "0" : return NEW;
			case "1" : return PARTIALLY_FILLED;
			case "2" : return FILLED;
			case "3" : return DONE_FOR_DAY;
			case "4" : return CANCELED;
			case "5" : return REPLACED;
			case "6" : return PENDING_CANCEL;
			case "7" : return STOPPED;
			case "8" : return REJECTED;
			case "9" : return SUSPENDED;
			case "A" : return PENDING_NEW;
			case "B" : return CALCULATED;
			case "C" : return EXPIRED;
			case "D" : return ACCEPTED_FOR_BIDDING;
			case "E" : return PENDING_REPLACE;
		}
		return null;
	}

}